# devtools::install_local("geneRefineR/", force = T)
library("geneRefineR")
library(readxl)
library(DT)
library(data.table)
library(dplyr)
library(ggplot2)
library(plotly)
library(cowplot)
library(ggrepel)
library(curl)
library(biomaRt)
library(sqldf)
# Ensembl LD API
library(httr)
library(jsonlite)
library(xml2)
library(gaston)
library(RCurl)
# *** susieR ****
# library(knitrBootstrap) #install_github('jimhester/knitrBootstrap')
library(susieR) # devtools::install_github("stephenslab/susieR")
sessionInfo()## R version 3.5.1 (2018-07-02)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS 10.14.3
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] susieR_0.6.2.0411 RCurl_1.95-4.11 bitops_1.0-6
## [4] gaston_1.5.4 RcppParallel_4.4.2 Rcpp_1.0.0
## [7] xml2_1.2.0 jsonlite_1.6 httr_1.4.0
## [10] sqldf_0.4-11 RSQLite_2.1.1 gsubfn_0.7
## [13] proto_1.0.0 biomaRt_2.38.0 curl_3.3
## [16] ggrepel_0.8.0 cowplot_0.9.4 plotly_4.8.0
## [19] ggplot2_3.1.0 dplyr_0.8.0.1 data.table_1.12.0
## [22] DT_0.5.2 readxl_1.3.0 geneRefineR_0.0.0.9000
##
## loaded via a namespace (and not attached):
## [1] lattice_0.20-38 tidyr_0.8.2 prettyunits_1.0.2
## [4] assertthat_0.2.0 digest_0.6.18 R6_2.4.0
## [7] cellranger_1.1.0 plyr_1.8.4 chron_2.3-53
## [10] stats4_3.5.1 evaluate_0.13 pillar_1.3.1
## [13] rlang_0.3.1 progress_1.2.0 lazyeval_0.2.1
## [16] blob_1.1.1 S4Vectors_0.20.1 Matrix_1.2-15
## [19] rmarkdown_1.11 stringr_1.4.0 htmlwidgets_1.3
## [22] bit_1.1-14 munsell_0.5.0 compiler_3.5.1
## [25] xfun_0.5 pkgconfig_2.0.2 BiocGenerics_0.28.0
## [28] htmltools_0.3.6 tcltk_3.5.1 tidyselect_0.2.5
## [31] expm_0.999-3 tibble_2.0.1 IRanges_2.16.0
## [34] XML_3.98-1.17 viridisLite_0.3.0 crayon_1.3.4
## [37] withr_2.1.2 grid_3.5.1 gtable_0.2.0
## [40] DBI_1.0.0 magrittr_1.5 scales_1.0.0
## [43] stringi_1.3.1 tools_3.5.1 bit64_0.9-7
## [46] Biobase_2.42.0 glue_1.3.0 purrr_0.3.0
## [49] hms_0.4.2 parallel_3.5.1 yaml_2.2.0
## [52] AnnotationDbi_1.44.0 colorspace_1.4-0 memoise_1.1.0
## [55] knitr_1.21
print(paste("susieR ", packageVersion("susieR")))## [1] "susieR 0.6.2.411"
list[top_SNPs, SumStats_sig] <- import_sig_GWAS(
file_path = "Data/Parkinsons/Nalls2018_S2_SummaryStats.xlsx",
sheet="Data",
chrom_col = "CHR", position_col = "BP", snp_col="SNP",
pval_col="P, all studies", effect_col="Beta, all studies", gene_col="Nearest Gene",
caption= "Nalls et al. (2018) PD GWAS Summary Stats")
finemapped_PD <- finemap_geneList(top_SNPs, geneList=c("LRRK2","GBAP1","SNCA","VPS13C","GCH1"), #unique(top_SNPs$Gene)
filePath="Data/Parkinsons/META.PD.NALLS2014.PRS.tsv",
snp_col = "MarkerName", pval_col = "P.value")Extracting SNPs flanking lead SNP…
Creating LD matrix… LD Reference Panel = 1KG_Phase1 ped stats and snps stats have been set. ‘p’ has been set. ‘mu’ and ‘sigma’ have been set.
Fine mapping with SusieR… [1] “objective:-4890.90196469039” [1] “objective:-4890.86512255644” [1] “objective:-4890.86493793192” [1] “objective:-4890.86493700424”
## Warning in log(susieDF$Effect): NaNs produced
## Warning in log(susieDF$Effect): NaNs produced
## Warning: Removed 1 rows containing missing values (geom_hline).
1 / 10 (10%) of SNPs of the SNPs in the summary stats were confirmed after fine-mapping.
Extracting SNPs flanking lead SNP…
Creating LD matrix… LD Reference Panel = 1KG_Phase1 ped stats and snps stats have been set. ‘p’ has been set. ‘mu’ and ‘sigma’ have been set.
Fine mapping with SusieR… [1] “objective:-1768.43682307539” [1] “objective:-1767.99485312494” [1] “objective:-1767.99377794051” [1] “objective:-1767.99377530418” [1] “objective:-1767.99377529783” [1] “objective:-1767.99377529781”
## Warning in log(susieDF$Effect): NaNs produced
## Warning in log(susieDF$Effect): NaNs produced
## Warning: Removed 1 rows containing missing values (geom_hline).
0 / 10 (0%) of SNPs of the SNPs in the summary stats were confirmed after fine-mapping.
Extracting SNPs flanking lead SNP…
Creating LD matrix… LD Reference Panel = 1KG_Phase1 ped stats and snps stats have been set. ‘p’ has been set. ‘mu’ and ‘sigma’ have been set.
Fine mapping with SusieR… [1] “objective:-3587.57986639256” [1] “objective:-3584.84439532171” [1] “objective:-3584.84224690147” [1] “objective:-3584.84224525982” [1] “objective:-3584.84224525865” [1] “objective:-3584.84224525865”
## Warning in log(susieDF$Effect): NaNs produced
## Warning in log(susieDF$Effect): NaNs produced
2 / 10 (20%) of SNPs of the SNPs in the summary stats were confirmed after fine-mapping.
Extracting SNPs flanking lead SNP…
Creating LD matrix… LD Reference Panel = 1KG_Phase1 ped stats and snps stats have been set. ‘p’ has been set. ‘mu’ and ‘sigma’ have been set.
Fine mapping with SusieR… [1] “objective:-3928.09335227999” [1] “objective:-3928.05140701022” [1] “objective:-3928.05134302287” [1] “objective:-3928.05134292561”
## Warning in log(susieDF$Effect): NaNs produced
## Warning in log(susieDF$Effect): NaNs produced
## Warning: Removed 1 rows containing missing values (geom_hline).
1 / 10 (10%) of SNPs of the SNPs in the summary stats were confirmed after fine-mapping.
Extracting SNPs flanking lead SNP…
Creating LD matrix… LD Reference Panel = 1KG_Phase1 ped stats and snps stats have been set. ‘p’ has been set. ‘mu’ and ‘sigma’ have been set.
Fine mapping with SusieR… [1] “objective:-2952.66209303207” [1] “objective:-2952.62332682449” [1] “objective:-2952.62312855485” [1] “objective:-2952.62312754298”
## Warning in log(susieDF$Effect): NaNs produced
## Warning in log(susieDF$Effect): NaNs produced
## Warning: Removed 1 rows containing missing values (geom_hline).
0 / 10 (0%) of SNPs of the SNPs in the summary stats were confirmed after fine-mapping.
list[top_SNPs, SumStats_sig] <- import_sig_GWAS(
file_path = "Data/Alzheimers/Posthuma/AD_target_SNP.xlsx",
sheet = 3,
chrom_col = "Chr", position_col = "bp", snp_col="SNP",
pval_col="P", effect_col="Z", gene_col="Gene",
caption= "Posthuma et al. (2018) AD GWAS Summary Stats")
finemapped_AD <- finemap_geneList(top_SNPs, geneList=c("CLU/PTK2B","APOE"), #unique(top_SNPs$Gene)
filePath="Data/Alzheimers/Posthuma/phase3.beta.se.hrc.txt",
effect_col = "BETA", stderr_col = "SE", position_col = "BP")## Warning: NAs introduced by coercion
## Warning: NAs introduced by coercion
Creating LD matrix… LD Reference Panel = 1KG_Phase1 ped stats and snps stats have been set. ‘p’ has been set. ‘mu’ and ‘sigma’ have been set.
Fine mapping with SusieR… [1] “objective:-6159.30949844661” [1] “objective:-6158.9541676718” [1] “objective:-6158.95404180037” [1] “objective:-6158.95404175575”
## Warning in log(susieDF$Effect): NaNs produced
## Warning in log(susieDF$Effect): NaNs produced
1 / 10 (10%) of SNPs of the SNPs in the summary stats were confirmed after fine-mapping.
## Warning: NAs introduced by coercion
## Warning: NAs introduced by coercion
+ Creating LD matrix… LD Reference Panel = 1KG_Phase1 ped stats and snps stats have been set. ‘p’ has been set. ‘mu’ and ‘sigma’ have been set.
## Warning in log(susieDF$Effect): NaNs produced
## Warning in log(susieDF$Effect): NaNs produced
0 / 10 (0%) of SNPs of the SNPs in the summary stats were confirmed after fine-mapping.